#include<iostream>
#include <signal.h>
#include<unistd.h>

using namespace std;

void handler(int signo)
{
    cout<<"process get a signal:"<<signo<<endl;
}


int main()
{
    signal(6,handler);
    int cnt=1;
    while(true)
    {
        printf("i am a process:%d\n",getpid());
        sleep(1);
        if(cnt%5)
        {
            //raise(9);
            abort();
        }
        cnt++;
    }

    return 0;
}